/*
 * Operational.cpp
 *
 *  Created on: Jan 27, 2011
 *      Author: bvd
 */

#include "Operational.h"

Operational* Operational::pInstance = 0;

Operational::Operational() {

}

Operational::~Operational() {
	delete pInstance;
}

void Operational::initOperational(Context* context) {
	context->setCurrentState(Operational::getInstance());
	pContext = new Context();
	pContext->setCurrentState(Ready::getInstance());
	pContext->handleCommand(new ConfigureCommand());
}

void Operational::restart(Context* context) {
	context->handleCommand(new RestartCommand());
}

Operational* Operational::getInstance() {
	if(!pInstance) {
		pInstance = new Operational();
	}
	return pInstance;
}
